package com.regent.central.bill.repository;

import com.regent.central.bill.core.SaleOrderRemark;
import com.regent.central.bill.dto.sale_order.SaleOrderDetailRemarkDTO;
import com.regent.central.bill.dto.sale_order.SaleOrderQueryRemarkDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface SaleOrderRemarkMapper extends Mapper<SaleOrderRemark> {

    /**
     * 获取销售单详情备注列表
     *
     * @param saleOrderId 销售单ID
     * @return 销售单详情备注列表
     */
    List<SaleOrderDetailRemarkDTO> getSaleOrderDetailRemarks(
            @Param("saleOrderId") String saleOrderId
    );

    /**
     * 获取多个销售单备注列表并集
     *
     * @param saleOrderIds 销售单ID
     * @return 多个销售单备注列表并集
     */
    List<SaleOrderQueryRemarkDTO> getSaleOrderQueryRemarksIn(
            @Param("saleOrderIds") String... saleOrderIds
    );

    /**
     * 获取多个销售单开单货品备注列表并集
     *
     * @param saleOrderIds 销售单ID
     * @return 多个销售单开单货品备注列表并集
     */
    List<SaleOrderQueryRemarkDTO> getSaleOrderQueryCreateGoodsRemarksIn(
            @Param("saleOrderIds") String... saleOrderIds
    );

    /**
     * 获取多个销售单退货货品备注列表并集
     *
     * @param saleOrderIds 销售单ID
     * @return 多个销售单退货货品备注列表并集
     */
    List<SaleOrderQueryRemarkDTO> getSaleOrderQueryReturnGoodsRemarksIn(
            @Param("saleOrderIds") String... saleOrderIds
    );

    /**
     * 伪删除销售单备注
     *
     * @param saleOrderRemarkId 销售单备注ID
     */
    void hide(
            @Param("saleOrderRemarkId") String saleOrderRemarkId,
            @Param("timeDeleted") long timeDeleted,
            @Param("userDeleted") String userDeleted
    );

    /**
     * 获取销售单的备注列表
     *
     * @param saleOrderId 销售单ID
     * @return 销售单的备注列表
     */
    List<SaleOrderRemark> getSaleOrderRemarks(
            @Param("saleOrderId") String saleOrderId
    );

}